package com.cmsky.open.food.model;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import com.cmsky.open.base.model.AreaInfo;
import com.cmsky.open.core.base.BaseEntity;

/**
 * @author jandyfish email:jandyfish(a)gmail.com
 * @version 1.0
 * @since 1.0
 */


public class FoodAreaInfo extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "FoodAreaInfo";
	public static final String ALIAS_ID = "编号";
	public static final String ALIAS_FOOD_ID = "餐品";
	public static final String ALIAS_AREA_ID = "社区";
	
	//date formats
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 编号       db_column: id 
     */	
	
	private java.lang.Integer id;
    /**
     * 餐品       db_column: food_id 
     */	
	
	private java.lang.Integer foodId;
    /**
     * 社区       db_column: area_id 
     */	
	
	private java.lang.Integer areaId;
	//columns END

	public FoodAreaInfo(){
	}

	public FoodAreaInfo(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setFoodId(java.lang.Integer value) {
		this.foodId = value;
	}
	
	public java.lang.Integer getFoodId() {
		return this.foodId;
	}
	public void setAreaId(java.lang.Integer value) {
		this.areaId = value;
	}
	
	public java.lang.Integer getAreaId() {
		return this.areaId;
	}
	
	private FoodInfo foodInfo;
	
	public void setFoodInfo(FoodInfo foodInfo){
		this.foodInfo = foodInfo;
	}
	
	public FoodInfo getFoodInfo() {
		return foodInfo;
	}
	
	private AreaInfo areaInfo;
	
	public void setAreaInfo(AreaInfo areaInfo){
		this.areaInfo = areaInfo;
	}
	
	public AreaInfo getAreaInfo() {
		return areaInfo;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("FoodId",getFoodId())
			.append("AreaId",getAreaId())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof FoodAreaInfo == false) return false;
		if(this == obj) return true;
		FoodAreaInfo other = (FoodAreaInfo)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.append(getFoodId(),other.getFoodId())
			.append(getAreaId(),other.getAreaId())
			.isEquals();
	}
}

